﻿<cfsilent>
	<cfscript>
		
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		propAdvice = getProperty("serviceFactory").getBean("studentPropertyAdvice");
		stringAdvice = getProperty("serviceFactory").getBean("stringAdvice");

		studentId = event.getArg("STU");
		
		/* 读取学生个人信息 */
		sql = "SELECT 
				stu_id, stu_name, stu_name_english, stu_sex, stu_birthday, stu_name_used, t_student.sbj_direction, area_code, 
				t_idcard_type.idtype_name, stu_idcard, 
				t_nation.nation_code, t_nation.nation_name, 
				t_class.cls_name, t_class.grade, t_class.cls_found, 
				t_subject.sbj_id, t_subject.sbj_name, t_subject.level_code, t_subject.schooling_length, 
				t_institute.institute_name
				FROM t_student 
				INNER JOIN t_idcard_type on t_idcard_type.idtype = t_student.idtype 
				INNER JOIN t_nation ON t_nation.nation_code = t_student.nation_code 
				INNER JOIN t_class ON t_class.cls_id = t_student.cls_id
				INNER JOIN t_subject ON t_subject.sbj_id = t_class.sbj_id 
				INNER JOIN t_institute ON t_institute.institute_id = t_subject.institute_id
				WHERE stu_id = :studentId ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );

		rs_student = queryObj.execute( sql=sql ).getResult();
		
		/* 学生学籍信息 */
		sql = "SELECT 
				candidatesno, status_code, date_join, homeaddr, zipcode, student_prop, stu_tel, 
				t_foster_type.foster_type, 
				t_student_type.student_type 
				FROM t_student_status 
				INNER JOIN t_foster_type ON t_foster_type.f_id = t_student_status.f_id 
				INNER JOIN t_student_type ON t_student_type.st_id = t_student_status.st_id 
				WHERE stu_id = :studentId ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		
		rs_profile = queryObj.execute( sql=sql ).getResult();
		
		/* 处理学籍状态 */
		propAdvice.parseProperty( rs_profile.student_prop );
		
		/* 学校信息 */
		sql = "SELECT sch_name FROM t_school ";
		
		queryObj = new Query( datasource=application.dnsSlave );

		rs_school = queryObj.execute( sql=sql ).getResult();
		
	</cfscript>
</cfsilent>

					<div class="noticeBlock">
						<h3>教育部学籍管理注册信息数据</h3>
						<hr/>
					</div>
					<table class="UItable withBorder">
						<tr>
							<td>考生号</td>
							<td colspan="3"><span class="number"><cfoutput>#rs_profile.candidatesno#</cfoutput></span></td>
							<td>学号</td>
							<td><span class="number"><cfoutput>#rs_student.stu_id#</cfoutput></span></td>
							<td style="padding:0;" width="135" height="180" valign="middle" align="center" rowspan="6"><img width="135" height="180" align="middle" src="<cfoutput>#getContextRoot()#</cfoutput>/acadmicManager/student/profile/<cfoutput>#rs_student.stu_id#</cfoutput>.jpg" /></td>
						</tr>
						<tr>
							<td>姓名</td>
							<td><cfoutput>#rs_student.stu_name#</cfoutput></td>
							<td>性别</td>
							<td><cfif rs_student.stu_sex eq "1">男<cfelse>女</cfif></td>
							<td>出生日期</td>
							<td><span class="number"><cfoutput>#datetimeAdvice.formatDateString( rs_student.stu_birthday )#</cfoutput></span></td>
						</tr>
						<tr>
							<td><cfoutput>#rs_student.idtype_name#</cfoutput></td>
							<td colspan="3"><span class="number"><cfoutput>#rs_student.stu_idcard#</cfoutput></span></td>
							<td>民族</td>
							<td><cfoutput>#rs_student.nation_name#</cfoutput></td>
						</tr>
						<tr>
							<td>院校名称</td>
							<td colspan="5"><cfoutput>#rs_school.sch_name#</cfoutput></td>
						</tr>
						<tr>
							<td>分院(系所)</td>
							<td colspan="5"><cfoutput>#rs_student.institute_name#</cfoutput></td>
						</tr>
						<tr>
							<td>专业名称</td>
							<td colspan="5"><cfoutput>#rs_student.sbj_name#</cfoutput></td>
						</tr>
						<tr>
							<td>层次</td>
							<td colspan="3"><cfoutput>#dictAdvice.getStudentLevel( rs_student.level_code )#</cfoutput></td>
							<td>学制</td>
							<td colspan="2"><cfoutput>#rs_student.schooling_length#</cfoutput>年</td>
						</tr>
						<tr>
							<td>培养方式</td>
							<td colspan="3"><cfoutput>#rs_profile.foster_type#</cfoutput></td>
							<td>学生类别</td>
							<td colspan="2"><cfoutput>#rs_profile.student_type#</cfoutput></td>
						</tr>
						<tr>
							<td>入学日期</td>
							<td colspan="3"><span class="number"><cfif rs_profile.date_join eq ""><cfoutput>#datetimeAdvice.formatDateString( rs_student.cls_found & "01")#</cfoutput><cfelse><cfoutput>#datetimeAdvice.formatDateString( rs_profile.date_join )#</cfoutput></cfif></span></td>
							<td>学籍状态</td>
							<td colspan="2"><cfoutput>#dictAdvice.getStudentCurrentStatus( rs_profile.status_code )#</cfoutput></td>
						</tr>
					</table>
					<div class="noticeBlock">
						<h3>校内学籍信息数据</h3>
						<hr/>
					</div>
					<table class="UItable withBorder">
						<tr>
							<td>学号</td>
							<td><span class="number"><cfoutput>#rs_student.stu_id#</cfoutput></span></td>
							<td>姓名</td>
							<td><cfoutput>#rs_student.stu_name#</cfoutput></td>
							<td>曾用名</td>
							<td><cfif rs_student.stu_name_used neq "">
									<cfoutput>#rs_student.stu_name_used#</cfoutput>
									<cfelse>
									-
								</cfif></td>
						</tr>
						<tr>
							<td>行政班</td>
							<td><cfoutput>#rs_student.cls_name#</cfoutput></td>
							<td>年级</td>
							<td><span class="number"><cfoutput>#rs_student.grade#</cfoutput></span></td>
							<td>预期毕业年份</td>
							<td><span class="number"><cfoutput>#int( ( rs_student.grade + rs_student.schooling_length ) )#</cfoutput></span></td>
						</tr>
						<tr>
							<td>是否在校</td>
							<td><cfif propAdvice.getInSchool()>是<cfelse><span class="alert">否</span></cfif></td>
							<td>专业</td>
							<td><cfoutput>#rs_student.sbj_name#</cfoutput></td>
							<td>专业方向</td>
							<td><cfif rs_student.sbj_direction eq "0">
									无
									<cfelse>
										<cfscript>
											sql = "SELECT sbj_name FROM t_subject WHERE sbj_id = :subjectDir ";
		
											queryObj = new Query( datasource=application.dnsSlave );
											queryObj.addParam( name="subjectDir", value= rs_student.sbj_id & rs_student.sbj_direction, cfsqltype="cf_sql_varchar" );

											rs_subject_dir = queryObj.execute( sql=sql ).getResult();
										</cfscript>
									<cfif rs_subject_dir.recordCount>
										<cfoutput>#rs_subject_dir.sbj_name#</cfoutput>
									</cfif>
								</cfif></td>
						</tr>
						<tr>
							<td>家庭通讯地址</td>
							<td colspan="5"><cfoutput>#stringAdvice.HTMLEncode( rs_profile.homeaddr )#</cfoutput> <cfif len( rs_profile.zipcode )><br/>邮编: <cfoutput>#stringAdvice.HTMLEncode( rs_profile.zipcode )#</cfoutput></cfif></td>
						</tr>
					</table>